package com.baitengsoft.patentapimonitor.api.service;

import com.baitengsoft.patentapimonitor.api.entity.WebPlatformareaEntity;
import com.baitengsoft.patentapimonitor.api.model.WebAreaInfo;
import com.baitengsoft.patentapimonitor.common.utils.PageResult;
import com.baitengsoft.patentapimonitor.common.utils.Res;
import com.baitengsoft.patentapimonitor.common.utils.SearchParam;

import java.util.List;

/**
 * Created by QEK on 2017/12/14.
 */
public interface WebPlatformareaService extends BaseService<WebPlatformareaEntity>{

    WebPlatformareaEntity selectAreaById(Integer id);

    int deleteAreaById(Integer id);

    Res updateArea(WebPlatformareaEntity entity);

    Res addAreaByPlatformId(WebPlatformareaEntity entity);

    PageResult<WebPlatformareaEntity> pageSelectAreas(Integer platformId, SearchParam searchParam);

    Integer savePlatformarea(WebPlatformareaEntity entity);

    Integer updatePlatformArea(WebPlatformareaEntity entity);

    List<WebPlatformareaEntity> searchByPlatformId(Integer platformId);

    /**
     * 只获取指定平台下的区域名称与id
     */
    List<WebAreaInfo> getNameAndIdByPlatformId(Integer platformId);

    /**
     * 根据平台Id查询区域IdList
     */
    List<Integer> getAreaIdsByPlatformId(Integer platformid);

    /**
     * 判断指定平台是否设置区域
     */
    boolean checkHasAreaByPlatormId(Integer platformid);

    /**
     * 判断指定平台排序检查是否用过，true通过，false不通过
     */
    boolean checkSortIsExitByPlatformId(Integer platformid, Integer sort);
}
